package com.zx.cloud.controller.client;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import com.zx.cloud.Shift;
import com.zx.cloud.common.auth0.jwt.Token;
import com.zx.cloud.controller.StatusCode;
import com.zx.cloud.domain.Client;
import com.zx.cloud.domain.Resource;
import com.zx.cloud.domain.User;
import com.zx.cloud.model.request.ManagerLoginRequest;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.model.response.Response;
import com.zx.cloud.util.Page;

/**
 * @author Alex
 */
@Component
public class ProviderClientFallback implements ProviderClient {
	
    private static final Logger LOGGER = LoggerFactory.getLogger(ProviderClientFallback.class);

    @Override
    public ObjectDataResponse<Page<Object>> findUser() {
        didNotGetResponse();
        Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
        return null;
    }

	@Override
	public ObjectDataResponse<Page<Object>> findUser2(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	
    private void didNotGetResponse() {
        LOGGER.error("service '{}' has become unreachable", ProviderClient.SERVICE_ID);
    }

	@Override
	public ObjectDataResponse<Page<Client>> queryClient(Client client) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<ManagerLoginRequest> demoTest(ManagerLoginRequest loginRequest) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<ManagerLoginRequest> demoTest2(ManagerLoginRequest loginRequest) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Token> loginTest(ManagerLoginRequest loginRequest) {
		didNotGetResponse();
		Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<ManagerLoginRequest> demoTest3() {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Page<Object>> page(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> insert(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> updateUser(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> deleteUser(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> banUser(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> startUser(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> getUser(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> accountQuery(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}


	@Override
	public ObjectDataResponse<Page<Object>> login() {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}

	@Override
	public ObjectDataResponse<Object> resetPassword(User user) {
		didNotGetResponse();
	    Shift.fatal(StatusCode.SERVER_IS_BUSY_NOW);
		return null;
	}
	
}
